//
//  YWYWPopupOrganizationCell.m
//  maintain
//
//  Created by Kyo on 15/12/25.
//  Copyright © 2015年 ewin. All rights reserved.
//

#import "YWPopupOrganizationCell.h"
#import "YWMacro.h"

@implementation YWPopupOrganizationCell

+ (instancetype)cellWithTableView:(UITableView *)tableView
{
    static NSString *identifier = @"YWPopupOrganizationCellIdentifier";
    YWPopupOrganizationCell *cell = [tableView dequeueReusableCellWithIdentifier:identifier];
    if (cell == nil) {
        cell = [[YWPopupOrganizationCell alloc]initWithStyle:UITableViewCellStyleSubtitle reuseIdentifier:identifier];
        cell.textLabel.font = KTitleFont;
        cell.separatorInset = UIEdgeInsetsMake(0, 20, 0, 0);
        cell.accessoryType = UITableViewCellAccessoryDisclosureIndicator;
    }
    return cell;
}

- (id)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier {
    self = [super initWithStyle:style reuseIdentifier:reuseIdentifier];
    if (self) {
    }
    return self;
}

-(void)layoutSubviews{
    [super layoutSubviews];
    self.imageView.contentMode = UIViewContentModeScaleAspectFill;
    self.imageView.layer.masksToBounds = YES;
    self.imageView.frame = CGRectMake(15, 5, 44, 44);
    
    self.textLabel.frame = CGRectMake(CGRectGetMaxX(self.imageView.frame)+15, 5, self.frame.size.width-30-CGRectGetMaxX(self.imageView.frame)-15, 44);
}

@end
